// 表格隔行换色功能
(function () {
    //获取table
    let table = document.getElementById("tal");
    //获取行数
    let rows = table.tBodies[0].rows.length;
    //tBodies是获取页面所有table元素，tBodies[0]是页面中第一个table元素
    console.log(table.tBodies[0]);
    //循环
    for (let i = 0; i < rows; i++) {
        if (i % 2 == 0) {
            table.tBodies[0].rows[i].style.backgroundColor = "#ffe89c";
        } else {
            table.tBodies[0].rows[i].style.backgroundColor = "#9fc4ff";
        }
    }
})();